import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

// 获取当前模块的文件路径
const __filename = fileURLToPath(import.meta.url);

// 获取当前文件的目录名
const __dirname = dirname(__filename);

const app = express();

app.use(express.static(path.join(__dirname, 'dist')));

app.get('*', function(req, res) {
    res.sendFile(path.join(__dirname, 'dist', 'index.html'));
});

app.listen(8088, () => {
    console.log('Vue app is running on http://10.78.34.117:8088');
});
